/*
 * @Description  :
 * @Autor        : 杜康
 * @Date         : 2023-03-07 16:38:49 +0800
 * @LastEditors  : 杜康
 * @LastEditTime : 2023-04-28 14:27:37 +0800
 */

import Qs from "qs";
import axios from "@/utils/api.request";
import system from "@/dao/vm/system";

// -> 用户登录
export const checkUser = (data) => {
  return axios.request({
    url: system.checkUser,
    data: Qs.stringify(data),
    method: "POST",
  });
};

// -> 获取用户信息
export const getUserInfoAjax = (data) => {
  return axios.request({
    url: system.getUserInfoAjax,
    data: Qs.stringify(data),
    method: "POST",
  });
};

// -> 发送短信
export const sendMessage = (data) => {
  return axios.request({
    url: system.sendMessage,
    data: Qs.stringify(data),
    method: "POST",
  });
};

// -> 校验验证码(NEW)
export const codeValidAjax = (data) => {
  return axios.request({
    url: system.codeValidAjax,
    data: Qs.stringify(data),
    method: "POST",
  });
};

// -> 重置密码(NEW)
export const resetPasswordAjax = (data) => {
  return axios.request({
    url: system.resetPasswordAjax,
    data: Qs.stringify(data),
    method: "POST",
  });
};

// 上传接口
export const commonUpload = (data, exOptions = {}) => {
  return axios.request({
    // 示例URL 需要替换为真实接口
    url: "/report/common/download",
    data: Qs.stringify(data),
    method: "POST",
    headers: {
      "content-type": "multipart/form-data",
    },
    ...exOptions,
  });
};
